package com.mpaster.meego.controller;

import com.mpaster.meego.entity.Privilege;
import com.mpaster.meego.service.PrivilegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class PrivilegeController {

    @Autowired
    private PrivilegeService privilegeService;

    @GetMapping("/privileges")
    public List<Privilege> getPrivileges(){
        return privilegeService.findAll();
    }
}
